package com.leng.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leng.entity.Menu;
import com.leng.mapper.MenuMapper;
import com.leng.service.MenuService;
import com.leng.utils.MenuTreeBuilder;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 菜单表 服务实现类
 * </p>
 *
 * @author leng
 * @since 2022-08-21
 */
@Service
public class MenuServiceImp extends ServiceImpl<MenuMapper, Menu> implements MenuService {

    @Override
    public List<Menu> findMenuTree() {
        //查询所有的菜单列表
        List<Menu> menus = this.baseMapper.selectList(null);
        //调用工具中的菜单树构建方法
        List<Menu> menuList = MenuTreeBuilder.build(menus);
        return menuList;
    }

    @Override
    public List<Long> findOpenIds() {
        return null;
    }
}
